/*! \file Library.h
 *	\brief <write description for Library.h>
 *
 *	created:	2009/11/12
 *	created:	12:11:2009   15:54
 *	filename: 	c:\src\main\libs\utils\Library.h
 *	file path:	c:\src\main\libs\utils
 *	file base:	Library
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _UTILS_LIBRARY_H_
#define _UTILS_LIBRARY_H_

#pragma once

#include "core/noncopyable.h"
#include "core/String.h"

namespace tt{
namespace utils{

#if defined(TT_WIN32)
typedef HMODULE LibraryHandler;
#elif defined(TT_UNIX)
typedef void* LibraryHandler;
#else //defined(TT_UNIX)
#error "Unsupported platform!!"
#endif //defined(TT_WIN32)

class Library : NonCopyable
{
public:
	Library(const String&);
	~Library(void);

	bool valid() const;

	operator LibraryHandler() const;

	void* GetProcAddress(const Char*);
	void* GetProcAddress(const String&);

private:
	LibraryHandler m_library;
};

} //namespace utils
} //namespace tt

#endif //_UTILS_LIBRARY_H_
